<template>
	<view class="all">
		<view class="top">
			<image class="top_img" src="../../../static/dw.png"></image>
			<view class="top_rights">
				<view>收货人 {{orderInfo.contactor}} <text>{{orderInfo.contactor_phone}}</text></view>
				<view>收货地址：{{orderInfo.address}}</view>
			</view>
		</view>
		<view class="xian">
			<image class="top_img2" src="../../../static/xian.png"></image>
		</view>
		<view class="content">
			<view class="list">
				<view class="lista">
					<view class="list_top">
						<view>订单编号：{{orderInfo.order_sn}}</view>
						<view>{{orderInfo.create_time_text}}</view> 
					</view>
					<view class="j_lista" v-for="item in orderInfo.products" @click="toProduct(item)" :key='item.id'>
						<image class="t_img" :src="item.images[0]"></image>
						<view class="j_right">
							<view class="t_title">{{item.title}}</view>
							<view class="price2">
								<view>￥<text class="bigs">{{item.price || '0.00'}}</text></view>
								<view>{{item.quantity}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class="list_bot">
					<view>配送费</view>
					<view>{{orderInfo.delivery_price || '0.00'}}</view>
				</view>
				<view class="list_bot list_bot2">
					<view>优惠</view>
					<view>{{orderInfo.discount_price || '0.00'}}</view>
				</view>
				<view class="dingdan">
					订单信息
				</view>
				<view class="list_bot3">
					<view>订单编号</view>
					<view class="bot3_right">{{orderInfo.order_sn}}</view>
				</view>
				<view class="list_bot3">
					<view>下单时间</view>
					<view class="bot3_right">{{orderInfo.create_time_text}}</view>
				</view>
			</view>
			<view class="bottoms">合计：<text class="reds">{{orderInfo.order_price || '0.00'}}</text></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderInfo: {},
				order_sn: null,
				state: 0
			}
		},
		onLoad(option) {
			this.order_sn = option.order_sn
			this.loadData()
		},
		methods: {
			loadData() {
				this.$http.get('jinorder.info', {
					order_sn: this.order_sn
				}).then(res => {
					this.orderInfo = res.data;
				})
			},
			toProduct(item) {
				uni.navigateTo({
					url: '/pages/product/product?id=' + item.product_id
				})
			}
		}
	}
</script>

<style>
	page{
		width: 100%;
		font-size: 30upx;
	}
	.top,.list_top,.list_bot,.list_bot3{
		display: flex;
		justify-content: flex-start;
		align-items: center;
	}
	.top{
		width: 100%;
		padding: 20upx;
	}
	.top_img{
		width: 60upx;
		height: 70upx;
	}
	.xian{
	}
	.top_img2{
		width: 100%;
		height: 25upx;
	}
	.top_rights{
		width: 70%;
		padding-left: 50upx;
	}
	.top_rights view{
		width: 100%;
		padding: 10upx 0;
	}
	.content{
		/* padding: 20upx; */
	}
	.list{
		padding: 20upx 20upx 90upx 20upx;
		border-bottom: 1upx solid #F2F2F2;
	}
	.lista{
		padding: 15upx;
		border-radius: 10upx;
		box-shadow:0 3upx 5upx 5upx #F2F2F2;
	}
	.list_top{
		padding: 20upx 0;
		justify-content: space-between;
		border-bottom: 1upx dashed #F2F2F2;
	}
	.j_lista{
		padding: 10upx 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.j_right{
		padding-left: 20upx;
		width: 70%;
	}
	.price2{
		padding: 20upx 0!important;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.j_lista_bot{
		text-align: right;
		padding: 0 30upx;
	}
	.grays{
		color: #848484;
	}
	.bigs2{
		font-size: 38upx;
	}
	.t_img{
		width: 150upx;
		height: 150upx;
		border-radius: 5upx;
		box-shadow: 0 0 10upx 3upx gray;
		margin: 10upx;
	}
	.list_bot{
		justify-content: space-between;
		padding: 30upx;
	}
	.list_bot2{
		border-top: 5upx solid #F8F8F8;
		border-bottom: 25upx solid #F8F8F8;
	}
	.dingdan{
		text-indent: 20upx;
		border-left: 8upx solid #FF4937;
		margin: 30upx 0;
	}
	.list_bot3{
		padding: 20upx 0!important;
	}
	.bot3_right{
		padding-left: 50upx;
	}
	.bottoms{
		padding: 30upx;
		text-align: right;
	}
	.reds{
		color: #FF4937;
		font-size: 35upx;
	}
</style>
